/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.fzhucc.modules.appletShow.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yyg
* @date 2022-11-16
**/
@Entity
@Data
@Table(name="pms_applet_show")
public class AppletShow implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "名称")
    private String name;

    @Column(name = "`img`")
    @ApiModelProperty(value = "banner图片")
    private String img;

    @Column(name = "`intro`")
    @ApiModelProperty(value = "简介")
    private String intro;

    /**
     * 标签
     */
    @Column(name = "`field`")
    private String field;

    @Column(name = "`type`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "类型")
    private String type;

    @Column(name = "`is_show`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否展示小程序")
    private Integer isShow;

    @Column(name = "`sort`")
    @ApiModelProperty(value = "显示顺序")
    private Integer sort;

    @Column(name = "`create_user_id`")
    @ApiModelProperty(value = "创建者user_id")
    private Long createUserId;

    @Column(name = "`level`")
    @ApiModelProperty(value = "项目等级")
    private Integer level;

    @Column(name = "`is_push`")
    @ApiModelProperty(value = "是否推送  服务项目才有推送 默认不推送")
    private Integer isPush;

    public void copy(AppletShow source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
